
import arrow

from app.db.models.packages import (
    Packages,
    ChargeType,
    Balance,
    Feature
)


def add_ws_task_time_model():
    """
    增加定时执行web安全监测任务模块
    """
    limit = Balance()
    limit.wsTaskTime.total = 1
    feature = Feature()
    feature.wsTaskTime = True
    package = Packages(
        limit=limit,
        feature=feature,
        packageMarks="单次套餐,周期性任务套餐",
        marks="定时执行web安全监测任务模块",
        name="ScanV_扫描时间控制",
        key="scanv_wsTaskTime",
        chargeType=ChargeType.addition_package.value,
        createTime=arrow.utcnow().datetime,
        operator="admin@knownsec.com"
    )
    package.save()
